import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Index",
    component: () => import("../views/Index.vue"),
  },
  {
    path: "/quit",
    name: "QuitWindow",
    component: () => import("../views/QuitWindow.vue"),
  },
  {
    path: "/preferences",
    name: "PreferencesWindow",
    component: () => import("../views/Preferences.vue"),
    redirect: "/general",
    children: [
      {
        path: "/general",
        name: "General",
        component: () =>
          import(
            "../components/PreferencesWindow/PreferencesWindowContent/General.vue"
          ),
      },
      {
        path: "/export",
        name: "Export",
        component: () =>
          import(
            "../components/PreferencesWindow/PreferencesWindowContent/Export.vue"
          ),
      },
      {
        path: "/account",
        name: "Account",
        component: () =>
          import(
            "../components/PreferencesWindow/PreferencesWindowContent/Account.vue"
          ),
      },
      {
        path: "/version",
        name: "Version",
        component: () =>
          import(
            "../components/PreferencesWindow/PreferencesWindowContent/Version.vue"
          ),
      },
      {
        path: "/terms",
        name: "Terms",
        component: () =>
          import(
            "../components/PreferencesWindow/PreferencesWindowContent/Terms.vue"
          ),
      },
    ],
  },
  {
    path: "/datalist",
    name: "DataList",
    component: () => import("../views/Datalist.vue"),
  },
];

const router = new VueRouter({
  routes,
});

export default router;
